package com.yidu.hbatsams.service.Impl;

import com.yidu.hbatsams.dao.AtsSchemeExpertMapper;
import com.yidu.hbatsams.domain.AtsSchemeExpert;
import com.yidu.hbatsams.service.AtsSchemeExpertFsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;
@Service
public class AtsSchemeExpertFsImpl implements AtsSchemeExpertFsService {
    @Resource
    private AtsSchemeExpertMapper daoMapper;
    @Override
    public List<AtsSchemeExpert> selectAll() {
        List<AtsSchemeExpert> list=daoMapper.selectAll();
        return list;
    }

    @Override
    public int deleteByPrimaryKey(int id) {
        return daoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(AtsSchemeExpert record) {
        return daoMapper.insert(record);
    }

    @Override
    public AtsSchemeExpert selectBySchemeId(Integer schemeId) {
        return daoMapper.selectBySchemeId(schemeId);
    }

    @Override
    public int insertSelective(AtsSchemeExpert record) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        record.setApplyForTime(simpleDateFormat.format(new java.sql.Date(System.currentTimeMillis())));
        record.setCreatTime(new java.sql.Date(System.currentTimeMillis()));
        record.setRemark("运动营养方案");
        record.setAuditState("10");
        return daoMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(AtsSchemeExpert record) {
        return daoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateBySaId(AtsSchemeExpert atsSchemeExpert) {
        return daoMapper.updateBySaId(atsSchemeExpert);
    }

    @Override
    public AtsSchemeExpert selectExpertBySeId(Integer seId) {
        return daoMapper.selectExpertBySeId(seId);
    }

    @Override
    public AtsSchemeExpert selectExpertBySaId(Integer saId) {
        return daoMapper.selectExpertBySaId(saId);
    }

    @Override
    public int updateSchemeName(Integer schemeId, String saName) {
        return daoMapper.updateSchemeName(schemeId,saName);
    }

    @Override
    public int deleteScheme(Integer schemeId) {
        return daoMapper.deleteScheme(schemeId);
    }

    @Override
    public AtsSchemeExpert selectByPrimaryKey(Integer seId) {
        return daoMapper.selectByPrimaryKey(seId);
    }

}
